import { userService } from './../../../services/user.service.js';

// 客户端控制器
export const getUserProfile = async (req, res) => {
  console.log('getUserProfile 处理中', req);
  const user = await userService.getPublicProfile(req.user.id);
  res.json(user); // 只返回客户端需要的字段
};

// 管理后台控制器 (`admin/controller.js`)
export const searchUsers = async (req, res) => {
  const users = await userService.searchWithSensitiveInfo(req.query);
  res.json(users); // 返回完整信息
};